package com.zlc.study.controller;

import com.zlc.study.service.ChatAssistant;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DeclarativeAIServiceController {
    @Resource
    private ChatAssistant chatAssistant;

    @GetMapping("/lc4j/boot/declarative")
    public String declarative(@RequestParam(value="prompt",defaultValue = "你是谁?")String prompt){
        System.out.println("通过langchain4j调用模型返回结果：\n" + chatAssistant.Chat(prompt));
        return chatAssistant.Chat(prompt);
    }
}
